<!--
 * @Author: xjt
 * @Date: 2021-06-26 11:16:01
 * @LastEditTime: 2021-06-26 14:11:18
 * @Description: 离点登记
 * @LastEditors: xjt
-->
<template>
  <div class="basic-form">
    <dataList :listData="tableData" pure :noPadding="true">
      <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column type="index" width="50"></el-table-column>
        <el-table-column prop="personState" label="人员状态" width="120">
          <template slot-scope="scope">
            {{
            scope.row.personState | dict("person_state")
            }}
          </template>
        </el-table-column>
        <el-table-column prop="releaseIsolationDate" label="解除隔离时间" width="150"></el-table-column>
        <el-table-column prop="leaveHotelDate" label="离开隔离点时间" width="150"></el-table-column>
        <el-table-column prop="leaveDestination" label="目的地" width="100"></el-table-column>
        <el-table-column prop="vehicle" label="交通工具">
          <template slot-scope="scope">{{scope.row.vehicle | dict("trip_traffic_way") }}</template>
        </el-table-column>
        <el-table-column prop="carNumber" label="班次号" width="150"></el-table-column>
        <el-table-column prop="remark" label="备注" show-overflow-tooltip></el-table-column>
      </el-table>
    </dataList>
  </div>
</template>

<script>
import { getLeaveInfo } from "../api/info";
import { mixinsId } from "../mixin/mixinId";
export default {
  name: "leaveInfo",
  mixins: [mixinsId],
  provide() {
    return {
      //初始化数据
      initList: this.queryData,
    };
  },
  inject: ["personId"],
  data() {
    return {
      tableData: [],
      // 页面loading
      loading: false,
    };
  },
  mounted() {
    this.$bus.$on("previewInfoOpen", () => {
      this.queryData();
    });
  },
  methods: {
    queryData() {
      this.loading = true;
      getLeaveInfo(this.id)
        .then((res) => {
          const { records } = res.data.data;
          this.tableData = records;
        })
        .finally(() => {
          this.loading = false;
        });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
